package br.com.lucasmatos.cap03;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.app.Activity;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.table);
		
		final TextView txtMsg = (TextView)findViewById(R.id.txtvMsg);
		final EditText edit = (EditText)findViewById(R.id.edtText);
		Button btnTable = (Button)findViewById(R.id.btnTable);
		
		btnTable.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
			String nome = edit.getEditableText().toString();
			txtMsg.setText(getString(R.string.msg_label,nome));
			txtMsg.setVisibility(View.VISIBLE);
			}
		});
	}	

}
